<!DOCTYPE html>
<html>
<head>
    <title>五宝回收</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="${s.base}/mobile/css/weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/base.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/component.css?1232445">
    <style type="text/css">
		body,html{background: #e4e4e4;}
        .xyg-list{width:96%;height:auto; margin:0.5rem 2%;}
        .xyg-list .xyg-list-item{width:94%;height:auto;padding:0.5rem 3%; margin-bottom:0.5rem; background:#ffffff;border-radius:10px; }
        .xyg-list .xyg-list-item .xyg-list-item-title{width:100%;height:60px; font-size:32px; font-weight:bold; color:#000;}
        .xyg-list .xyg-list-item .xyg-list-item-line{width:100%;height:50px; line-height:50px; font-size:28px;color:#999;}
        .xyg-list .xyg-list-item .xyg-list-item-btn{width:100%;height:50px;}
    </style>
</head>
<body>
<div style="width:100%;height:auto;"><img src="/mobile/images/banner3.jpg"></div>
  <div class="xyg-comp-type-two">
    <div class="xyg-comp-type-item select-active" data-values="1">
    未处理
    </div>
    <div class="xyg-comp-type-item" data-values="2">
    已处理
    </div>
    <div class="clearBoth"></div>
</div>

<div class="xyg-list" id="showList">

</div>

<div class="xyg-product-list_loadmore weui-loadmore clearBoth">
  <i class="weui-loading"></i>
  <span class="weui-loadmore__tips">正在加载</span>
</div>

</body>
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script src="${s.base}/mobile/js/jquery-2.1.4.js"></script>
<script src="${s.base}/mobile/js/jquery-weui.js"></script>
<script src="${s.base}/mobile/js/iscroll.js"></script>
<script src="${s.base}/mobile/fonts/iconfont.js"></script>
<script src="${s.base}/mobile/js/component.js"></script>
<script src="${s.base}/mobile/js/base.js"></script>

<!--js分享代码开始-->
<input type="hidden" value="${jSTicketShareResponse.appid}" id="appid" />
<input type="hidden" value="${jSTicketShareResponse.fxTitle}" id="fxTitle" />
<input type="hidden" value="${jSTicketShareResponse.fxImgUrl}" id="fxImgUrl" />
<input type="hidden" value="${jSTicketShareResponse.fxDesc}" id="fxDesc" />
<input type="hidden" value="${jSTicketShareResponse.fxUrl}" id="fxUrl" />
<input type="hidden" value="${jSTicketShareResponse.nonceStr}" id="nonceStr" />
<input type="hidden" value="${jSTicketShareResponse.timestamp}" id="timestamp" />
<input type="hidden" value="${jSTicketShareResponse.signature}" id="signature" />
<script src="${s.base}/mobile/js/share.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
       $('.wrapper').navbarscroll();
    });

    var memberId = '${memberId}';
    var pageStart=0;
    var num=10;
    var loading = false;  //状态标记
    var status="1";
    sendPost();
    $(document).ready(function(e) {
        initPage();
        $(document.body).infinite().on("infinite", function() {
            if(loading) return;
            loading = true;
            sendPost();
        });
    });

    function initPage() {
        $(document.body).infinite();
        $(".xyg-product-list_loadmore").show();
    }

    $(".xyg-comp-type-two .xyg-comp-type-item").bind("click", function () {
        status = $(this).attr("data-values");
        $(".xyg-comp-type-two .xyg-comp-type-item").removeClass("select-active");
        $(this).addClass("select-active");
        $("#showList").html("");

        pageStart=0;
        initPage();
        sendPost();
    });

    function sendPost() {
        $("#showContent").hide();
        pageStart++;
        $.post("/phone/recoveryCircleOrderJsonList",{
            pageSize : num,
            pageNum : pageStart,
            status : status,
            memberId : memberId,
            removeTag:"1"
        },function(resultInfo){
            if (resultInfo.data!=null && resultInfo.data.length > 0){
                for(var j=0;j<resultInfo.data.length;j++){
                    var recoveryCircleOrder = resultInfo.data[j];
                    var status = recoveryCircleOrder.status;
                    // 状态。1=未处理2=已处理
                    var statusCss = "";
                    if (status=="1"){
                        statusCss="未处理";
                    } else if (status == "2") {
                        statusCss="已处理";
                    }
                    var str='<div class="xyg-list-item" onclick="goCircleOrderShowPage(\''+memberId+'\',\''+recoveryCircleOrder.id+'\',1)">\
                        <div class="xyg-list-item-title font-grade-one">'+recoveryCircleOrder.content+'</div>\
                    <div class="xyg-list-item-line">订单状态：'+statusCss+'</div>\
                    <div class="xyg-list-item-line">预约时间：'+recoveryCircleOrder.reserveTime+'</div>\
                    <div class="xyg-list-item-line">下单时间：'+new Date(recoveryCircleOrder.createTime).format("yyyy-MM-dd hh:mm:ss")+'</div>\
                    </div>';

                    $("#showList").append(str);
                    loading = false;
                    if(!resultInfo.hasNextPage){
                        $(document.body).destroyInfinite();
                        $(".xyg-product-list_loadmore").hide();
                    }
                }
            }else{
                $(document.body).destroyInfinite();
                $(".xyg-product-list_loadmore").hide();
            }
        },"json");
    }
</script>
</html>
